package com.woniuxy.store.core.mapper;

import com.woniuxy.store.core.model.PmMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gmx
 * @since 2021-07-06
 */
public interface PmMessageMapper extends BaseMapper<PmMessage> {
    @Select("SELECT * FROM pm_message WHERE type=0")
    List<PmMessage> selectAnnouncementMessage();
    @Select("SELECT * FROM pm_message WHERE type=1 AND store_id=#{storeId}")
    List<PmMessage> selectNotification(Integer storeId);
    @Select("SELECT * FROM pm_message WHERE type=2")
    List<PmMessage> selectEventNotification();

    int postAMessage(PmMessage message);
}
